import { createWebHistory, createRouter } from 'vue-router'

//引入组件
import Home from '../views/Home/index.vue'
import Login from '../views/Login/index.vue'
import Layout from '../views/Layout/index.vue'
import Product from '../views/Product/index.vue'
import NotFound from '../views/NotFound/404.vue'

// 配置路由规则
export const routes = [
  {
    path: '/',
    component: Login,
    children: [
      { path: '/home', component: Home, name: 'home', hidden: true },
      { path: '/product', component: Product, name: 'product' }
    ]
  },
  { path: '/layout', component: Layout, name: 'layout' }
]
// 创建路由对象
const router = createRouter({
  history: createWebHistory(),
  routes
})
export default router
